<template>
  <div>
    <el-table :data="list" border style="width: 100%">
      <el-table-column prop="id" label="角色编号" width="180"></el-table-column>
      <el-table-column prop="rolename" label="所属角色" width="180"></el-table-column>
      <el-table-column prop="status" label="状态">
        <template ref="slot" slot-scope="scope">
          <el-button type="primary" v-if="scope.row.status === 1">启用</el-button>
          <el-button type="danger" v-else @click="form.status === 1">禁止</el-button>
        </template>
      </el-table-column>
      <el-table-column prop="name" label="操作">
        <template slot-scope="scope">
          <el-button type="primary" @click="willEdit(scope.row.uid)">编辑</el-button>
          <del-btn @confirm="del(scope.row.uid)"></del-btn>
        </template>
      </el-table-column>
    </el-table>
    <!-- {{count}} -->
    
  </div>
</template>

<script>
import { requserdelete } from "../../../request/api";
import { successAlert } from "../../../utils/alert";
export default {
  mounted() {},
  methods: {
    //   点击修改
    willEdit(uid) {
      this.$emit("willEdit", uid);
    },


    // 点击删除
    del(uid) {
      requserdelete({
        uid: uid,
      }).then((res) => {
        if (res.data.code === 200) {
          successAlert(res.data.msg);
          this.$emit("init");
        }
      });
    },
  },
  props: ["list", "size", "count"],
  data() {
    return {};
  },
};
</script>

<style>
</style>